/*  1:   */ package org.intellij.images.editor.impl;
/*  2:   */ 
/*  3:   */

import com.intellij.openapi.fileEditor.FileEditor;
import com.intellij.openapi.fileEditor.FileEditorPolicy;
import com.intellij.openapi.fileEditor.FileEditorProvider;
import com.intellij.openapi.fileEditor.FileEditorState;
import com.intellij.openapi.project.DumbAware;
import com.intellij.openapi.project.Project;
import com.intellij.openapi.util.Disposer;
import com.intellij.openapi.vfs.VirtualFile;
import org.intellij.images.fileTypes.ImageFileTypeManager;
import org.jdom.Element;
import org.jetbrains.annotations.NonNls;
import org.jetbrains.annotations.NotNull;

/*  4:   */
/*  5:   */
/*  6:   */
/*  7:   */
/*  8:   */
/*  9:   */
/* 10:   */
/* 11:   */
/* 12:   */
/* 13:   */
/* 14:   */
/* 15:   */ 
/* 16:   */ final class ImageFileEditorProvider
/* 17:   */   implements FileEditorProvider, DumbAware
/* 18:   */ {
/* 19:   */   @NonNls
/* 20:   */   private static final String a = "images";
/* 21:   */   private final ImageFileTypeManager b;
/* 22:   */   
/* 23:   */   ImageFileEditorProvider(ImageFileTypeManager paramImageFileTypeManager)
/* 24:   */   {
/* 25:42 */     this.b = paramImageFileTypeManager;
/* 26:   */   }
/* 27:   */   
/* 28:   */   public boolean accept(@NotNull Project paramProject, @NotNull VirtualFile paramVirtualFile)
/* 29:   */   {
/* 30:47 */     if (paramProject == null) {
/* 31:47 */       throw new IllegalArgumentException(String.format("Argument %s for @NotNull parameter of %s.%s must not be null", new Object[] { "0", "org/intellij/images/editor/impl/ImageFileEditorProvider", "accept" }));
/* 32:   */     }
/* 33:47 */     if (paramVirtualFile == null) {
/* 34:47 */       throw new IllegalArgumentException(String.format("Argument %s for @NotNull parameter of %s.%s must not be null", new Object[] { "1", "org/intellij/images/editor/impl/ImageFileEditorProvider", "accept" }));
/* 35:   */     }
/* 36:47 */     return this.b.isImage(paramVirtualFile);
/* 37:   */   }
/* 38:   */   
/* 39:   */   @NotNull
/* 40:   */   public FileEditor createEditor(@NotNull Project paramProject, @NotNull VirtualFile paramVirtualFile)
/* 41:   */   {
/* 42:53 */     if (paramProject == null) {
/* 43:53 */       throw new IllegalArgumentException(String.format("Argument %s for @NotNull parameter of %s.%s must not be null", new Object[] { "0", "org/intellij/images/editor/impl/ImageFileEditorProvider", "createEditor" }));
/* 44:   */     }
/* 45:53 */     if (paramVirtualFile == null) {
/* 46:53 */       throw new IllegalArgumentException(String.format("Argument %s for @NotNull parameter of %s.%s must not be null", new Object[] { "1", "org/intellij/images/editor/impl/ImageFileEditorProvider", "createEditor" }));
/* 47:   */     }
/* 48:53 */     void tmp89_86 = new ImageFileEditorImpl(paramProject, paramVirtualFile);
/* 49:53 */     if (tmp89_86 == null) {
/* 50:53 */       throw new IllegalStateException(String.format("@NotNull method %s.%s must not return null", new Object[] { "org/intellij/images/editor/impl/ImageFileEditorProvider", "createEditor" }));
/* 51:   */     }
/* 52:53 */     return tmp89_86;
/* 53:   */   }
/* 54:   */   
/* 55:   */   public void disposeEditor(@NotNull FileEditor paramFileEditor)
/* 56:   */   {
/* 57:58 */     if (paramFileEditor == null) {
/* 58:58 */       throw new IllegalArgumentException(String.format("Argument %s for @NotNull parameter of %s.%s must not be null", new Object[] { "0", "org/intellij/images/editor/impl/ImageFileEditorProvider", "disposeEditor" }));
/* 59:   */     }
/* 60:58 */     Disposer.dispose(paramFileEditor);
/* 61:   */   }
/* 62:   */   
/* 63:   */   @NotNull
/* 64:   */   public FileEditorState readState(@NotNull Element paramElement, @NotNull Project paramProject, @NotNull VirtualFile paramVirtualFile)
/* 65:   */   {
/* 66:64 */     if (paramElement == null) {
/* 67:64 */       throw new IllegalArgumentException(String.format("Argument %s for @NotNull parameter of %s.%s must not be null", new Object[] { "0", "org/intellij/images/editor/impl/ImageFileEditorProvider", "readState" }));
/* 68:   */     }
/* 69:64 */     if (paramProject == null) {
/* 70:64 */       throw new IllegalArgumentException(String.format("Argument %s for @NotNull parameter of %s.%s must not be null", new Object[] { "1", "org/intellij/images/editor/impl/ImageFileEditorProvider", "readState" }));
/* 71:   */     }
/* 72:64 */     if (paramVirtualFile == null) {
/* 73:64 */       throw new IllegalArgumentException(String.format("Argument %s for @NotNull parameter of %s.%s must not be null", new Object[] { "2", "org/intellij/images/editor/impl/ImageFileEditorProvider", "readState" }));
/* 74:   */     }
/* 75:64 */     FileEditorState tmp123_120 = FileEditorState.INSTANCE;
/* 76:64 */     if (tmp123_120 == null) {
/* 77:64 */       throw new IllegalStateException(String.format("@NotNull method %s.%s must not return null", new Object[] { "org/intellij/images/editor/impl/ImageFileEditorProvider", "readState" }));
/* 78:   */     }
/* 79:64 */     return tmp123_120;
/* 80:   */   }
/* 81:   */   
/* 82:   */   public void writeState(@NotNull FileEditorState paramFileEditorState, @NotNull Project paramProject, @NotNull Element paramElement)
/* 83:   */   {
/* 84:69 */     if (paramFileEditorState == null) {
/* 85:69 */       throw new IllegalArgumentException(String.format("Argument %s for @NotNull parameter of %s.%s must not be null", new Object[] { "0", "org/intellij/images/editor/impl/ImageFileEditorProvider", "writeState" }));
/* 86:   */     }
/* 87:69 */     if (paramProject == null) {
/* 88:69 */       throw new IllegalArgumentException(String.format("Argument %s for @NotNull parameter of %s.%s must not be null", new Object[] { "1", "org/intellij/images/editor/impl/ImageFileEditorProvider", "writeState" }));
/* 89:   */     }
/* 90:69 */     if (paramElement == null) {
/* 91:69 */       throw new IllegalArgumentException(String.format("Argument %s for @NotNull parameter of %s.%s must not be null", new Object[] { "2", "org/intellij/images/editor/impl/ImageFileEditorProvider", "writeState" }));
/* 92:   */     }
/* 93:   */   }
/* 94:   */   
/* 95:   */   @NotNull
/* 96:   */   public String getEditorTypeId()
/* 97:   */   {
/* 98:74 */     String tmp2_0 = "images";
/* 99:74 */     if (tmp2_0 == null) {
/* :0:74 */       throw new IllegalStateException(String.format("@NotNull method %s.%s must not return null", new Object[] { "org/intellij/images/editor/impl/ImageFileEditorProvider", "getEditorTypeId" }));
/* :1:   */     }
/* :2:74 */     return tmp2_0;
/* :3:   */   }
/* :4:   */   
/* :5:   */   @NotNull
/* :6:   */   public FileEditorPolicy getPolicy()
/* :7:   */   {
/* :8:80 */     FileEditorPolicy tmp3_0 = FileEditorPolicy.HIDE_DEFAULT_EDITOR;
/* :9:80 */     if (tmp3_0 == null) {
/* ;0:80 */       throw new IllegalStateException(String.format("@NotNull method %s.%s must not return null", new Object[] { "org/intellij/images/editor/impl/ImageFileEditorProvider", "getPolicy" }));
/* ;1:   */     }
/* ;2:80 */     return tmp3_0;
/* ;3:   */   }
/* ;4:   */ }



/* Location:           E:\idea\

 * Qualified Name:     org.intellij.images.editor.impl.ImageFileEditorProvider

 * JD-Core Version:    0.7.0.1

 */